package cn.com.dhcc.turbo.service.exch.cmdata;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.dhcc.app.core.dao.CrudDao;
import cn.com.dhcc.app.core.exception.DaoException;
import cn.com.dhcc.app.core.exception.ServiceException;
import cn.com.dhcc.app.core.service.AbstractCrudService;
import cn.com.dhcc.turbo.dao.exch.GapInfoDao;
import cn.com.dhcc.turbo.entity.exch.GapInfo;

@Service
public class GapInfoService extends AbstractCrudService<GapInfo> {
//	private static Logger logger = Log.getExistLogger(LOGTYPE.R);

	@Autowired
	private GapInfoDao dao;

	@Override
	public CrudDao<GapInfo> getCrudDao() {
		return dao;
	}
	
	public GapInfo getGapInfo() throws ServiceException{
		try {
			List<GapInfo> list=dao.list(null);
			if (list!=null && !list.isEmpty()) {
				return list.get(0);
			}
		} catch (DaoException e) {
			throw new ServiceException(e);
		}
		return null;
	}
}
